home *** CD-ROM | disk | FTP | other *** search
/ Best of www.BestZips.com (Collector's Edition) / Best of WWW.BESTZIPS.COM Collector's Edition (JCSM Shareware) (JCS Marketing).ISO / internet / spry1a.zip / SCRIPTS / SCRIPTS.Z / SECLOG.SCR < prev    next >
Text File  |  1996-03-22  |  2KB  |  79 lines

  1. !
  2. !  Copyright (c) 1995
  3. !  by CompuServe Incorporated, Columbus, Ohio
  4. !
  5. !  The information in this software is subject to change without
  6. !  notice and should not be construed as a commitment by CompuServe.
  7. !
  8. !  SECLOG:
  9. !    Handles secure login.
  10. !
  11. !+V
  12. ! "3.8"
  13. !-V
  14.  
  15. on cancel goto SecureCancel;
  16. define %SecFailTemp = "";
  17.  
  18.     wait
  19.         "."    goto Host_Challenge_Received
  20.     until 100;
  21.     goto Timeout;
  22.  
  23. Host_Challenge_Received:
  24.     HostChallenge = %Scanned;
  25.  
  26.     send "RB:^M^J" & %MicroChallenge & "aaa.^M^J";
  27.  
  28.     define %UserResponse = "";
  29.     encode HostChallenge, %MicroChallenge, %Password, %UserResponse;
  30.  
  31.     if %UserResponse <> "" goto Send_Micro_Response;
  32.  
  33.     define %SecFailTemp = "Application error, out of resources";
  34.     define %ErrorCode = 33;
  35.     exit %Failure;
  36.  
  37. Send_Micro_Response:
  38.     send "UR:^M^J" & %UserResponse & ".^M^J";
  39.  
  40.     wait
  41.         "No."    goto Response_Refused,
  42.         "HR:"    goto Handle_Host_Response
  43.     until 100;
  44.     goto Timeout;
  45.  
  46. Response_Refused:
  47.     define %SecFailTemp = "Incorrect User ID or password";
  48.     define %ErrorCode = 34;
  49.     exit %Failure;
  50.  
  51.  
  52. Handle_Host_Response:
  53.     wait
  54.         "." goto Host_Response_Received
  55.     until 100;
  56.  
  57. Timeout:
  58.     define %SecFailTemp = "Host not responding to login request";
  59.     define %ErrorCode = 32;
  60.     exit %Failure;
  61.  
  62. Host_Response_Received:
  63.     define %HostResponse = %Scanned;
  64.     define %Approved = 0;
  65.  
  66.     approve HostChallenge, %MicroChallenge, %Password, %HostResponse, %Approved;
  67.  
  68.     if %Approved <> 0 goto Host_Response_Approved;
  69.  
  70.     define %SecFailTemp = "Secure response from host was invalid";
  71.     define %ErrorCode = 35;
  72.     exit %Failure;
  73.  
  74. Host_Response_Approved:
  75.     exit %Success;
  76.  
  77. SecureCancel:
  78.     exit %Cancel;
  79.